-- Removes all the words that comes from inconsistent quenstions and answers
DELETE FROM words
WHERE id IN
	(
		SELECT DISTINCT words.id
		FROM words
		WHERE words.id NOT IN (SELECT answer.id FROM answer)
		AND id NOT IN (SELECT question.id FROM question)
	)
AND tablename = 'posts';

-- Removes all the words that comes from inconsistent comments
DELETE FROM words
WHERE id IN
	(
		SELECT DISTINCT words.id
		FROM words
		WHERE words.id NOT IN (SELECT "comment".id FROM "comment")
	)
AND words.tablename = 'comments';